#
# @lc app=leetcode.cn id=1 lang=python3
#
# [1] 两数之和
#

# @lc code=start
from collections import defaultdict
from typing import Counter, List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        cnt = defaultdict(int)
        for i,x in enumerate(nums):
            if target - x in cnt:
                return [cnt[target - x], i]
            cnt[x] = i
        
# @lc code=end

